home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / pdcurs21 / portable / delay_ou.c < prev    next >
C/C++ Source or Header  |  1993-06-19  |  2KB  |  71 lines

  1. #define    CURSES_LIBRARY    1
  2. /*#define NEEDS_OS2       1*/
  3. #include <curses.h>
  4. #undef    delay_output
  5.  
  6. #if defined(DOS) && defined(MSC)
  7. #include <time.h>
  8. #endif
  9.  
  10. #ifdef PDCDEBUG
  11. char *rcsid_delay_ou = "$Header: C:\CURSES\portable\RCS\delay_ou.c 2.1 1993/06/18 20:19:09 MH Rel MH $";
  12. #endif
  13.  
  14. #ifdef OS2
  15.     APIRET APIENTRY DosSleep(ULONG ulTime);
  16. #endif
  17.  
  18.  
  19. /*man-start*********************************************************************
  20.  
  21.   delay_output()    - cause short delay
  22.  
  23.   X/Open Description:
  24.      Insert ms millisecond pause in output.  On some systems, this
  25.      has no effect.
  26.  
  27.   PDCurses Description:
  28.      This routine relies on the compiler's delay() routine and
  29.      provides this x millisecond granularity to the application.
  30.  
  31.   X/Open Return Value:
  32.      The delay_output() function returns OK on success and ERR on error.
  33.  
  34.   PDCurses Errors:
  35.      If this function is a nop, then an ERR is returned.
  36.  
  37.   Portability:
  38.      PDCurses    int delay_output( int ms );
  39.      X/Open Dec '88    int delay_output( int ms );
  40.      BSD Curses    
  41.      SYS V Curses    
  42.  
  43. **man-end**********************************************************************/
  44.  
  45. int    delay_output( int ms )
  46. {
  47. #ifdef PDCDEBUG
  48.     if (trace_on) PDC_debug("delay_output() - called: ms %d\n",ms);
  49. #endif
  50.  
  51. #if defined(TC) && defined(DOS)
  52.     delay( ms );
  53.     return( OK );
  54. #endif
  55.  
  56. #if    defined(OS2)
  57.     DosSleep(ms);
  58.     return( OK );
  59. #endif
  60.  
  61. #if    defined(DOS) && defined(MSC)
  62.     PDC_usleep((clock_t)ms);
  63.     return( OK );
  64. #endif
  65.  
  66. #if defined(UNIX) || defined(EMX) || defined(GO32)
  67.     usleep(1000*ms);
  68.     return( OK );
  69. #endif
  70. }
  71.